package com.tarena.lbs.basic.service.impl;

import com.tarena.lbs.basic.dao.mapper.AreaMapper;
import com.tarena.lbs.basic.dao.repository.AreaRepository;
import com.tarena.lbs.basic.pojo.vo.AreaVO;
import com.tarena.lbs.basic.service.AreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;


@Service
public class AreaServiceImpl implements AreaService {
    @Autowired
    private AreaRepository areaRepository;

    @Override
    public List<AreaVO> selectAreaList(Integer parentId) {
        List<AreaVO> areaList = areaRepository.selectAreaList(parentId);
        return areaList;
    }

    @Override
    public List<AreaVO> selectChildrenList(Integer parentId) {
        List<AreaVO> childrenList = areaRepository.selectChildrenList(parentId);
        return childrenList;
    }

    @Override
    public List<AreaVO> selectreeList() {
        List<AreaVO> allAreas = areaRepository.selectAll();
        return allAreas;
    }
}